Reading layer `jakarta' from data source
`C:\Users\yozaf\SMUY3S2\Geospatial\IS415-GAA\Take-home_Ex\Take-home_Ex03\data\geospatial\rds'
using driver `ESRI Shapefile'
Simple feature collection with 260 features and 27 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 106.6862 ymin: -6.370731 xmax: 106.9733 ymax: -6.088227
Geodetic CRS: WGS 84 + EGM2008 height
1st Order Spatial Point Pattern Analysis: Kernel Density Estimation
Overview
We are using Spatial Point Pattern Analysis to answer these questions: 1. Are the locations of room rentals in Jakarta randomly distributed? 2. If not randomly distributed, where are the locations with high concentration of room rentals?
Packages
We are using five packages, loaded with the above chunk:
- sf to process geospatial data
- spatstat to perform the spatial point pattern analysis
- raster to convert the image output from spatstat into raster format
- maptools to handle ppp data
- tmap to plot the maps
- tidyverse for data wrangling
Data
Jakarta Data Loading
Note that the data is in a WGS 84 + EGM2008 height CRS. We can convert it to WGS84 with the chunk below
We can use qtm() to get a simple map of the jakarta data

Mamikos Data Loading
_id price_monthly latitude longitude
Min. : 1728989 Min. : 350000 Min. :-6.286 Min. :106.7
1st Qu.:32773220 1st Qu.: 1000000 1st Qu.:-6.239 1st Qu.:106.8
Median :55360905 Median : 1600000 Median :-6.202 Median :106.8
Mean :54976650 Mean : 1868027 Mean :-6.207 Mean :106.8
3rd Qu.:77177521 3rd Qu.: 2400000 3rd Qu.:-6.178 3rd Qu.:106.9
Max. :99992091 Max. :15000000 Max. :-6.130 Max. :106.9
gender area_city_keyword area_subdistrict status
Min. :0.0000 Length:8969 Length:8969 Min. :0.0000
1st Qu.:0.0000 Class :character Class :character 1st Qu.:0.0000
Median :1.0000 Mode :character Mode :character Median :0.0000
Mean :0.8145 Mean :0.6262
3rd Qu.:2.0000 3rd Qu.:2.0000
Max. :2.0000 Max. :2.0000
size fac_room fac_share fac_bath
Length:8969 Length:8969 Length:8969 Length:8969
Class :character Class :character Class :character Class :character
Mode :character Mode :character Mode :character Mode :character
fac_near fac_park kos_rule fac_price
Length:8969 Length:8969 Length:8969 Length:8969
Class :character Class :character Class :character Class :character
Mode :character Mode :character Mode :character Mode :character
owner_user_id building_year is_singgahsini is_apik
Min. : 6350 Min. : 0 Mode :logical Mode :logical
1st Qu.:1338529 1st Qu.:2015 FALSE:8499 FALSE:8853
Median :3475312 Median :2019 TRUE :470 TRUE :116
Mean :3535335 Mean :1991
3rd Qu.:5480051 3rd Qu.:2021
Max. :8163159 Max. :2024
NA's :5 NA's :984
is_elite number_success_owner_trx number_success_kos_trx
Mode :logical Min. : 0.0 Min. : 0.000
FALSE:8969 1st Qu.: 0.0 1st Qu.: 0.000
Median : 0.0 Median : 0.000
Mean : 688.7 Mean : 3.587
3rd Qu.: 3.0 3rd Qu.: 3.000
Max. :10961.0 Max. :241.000
url
Length:8969
Class :character
Mode :character
Note that the mamikos data has its location in the latitude and longitude columns, which we can convert to geometry in an sf dataframe
Coordinate Reference System:
User input: EPSG:4326
wkt:
GEOGCRS["WGS 84",
ENSEMBLE["World Geodetic System 1984 ensemble",
MEMBER["World Geodetic System 1984 (Transit)"],
MEMBER["World Geodetic System 1984 (G730)"],
MEMBER["World Geodetic System 1984 (G873)"],
MEMBER["World Geodetic System 1984 (G1150)"],
MEMBER["World Geodetic System 1984 (G1674)"],
MEMBER["World Geodetic System 1984 (G1762)"],
MEMBER["World Geodetic System 1984 (G2139)"],
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]],
ENSEMBLEACCURACY[2.0]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
CS[ellipsoidal,2],
AXIS["geodetic latitude (Lat)",north,
ORDER[1],
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433]],
USAGE[
SCOPE["Horizontal component of 3D system."],
AREA["World."],
BBOX[-90,-180,90,180]],
ID["EPSG",4326]]
We can plot the map with tmap